package com.sservice.urp.dao;


import com.sservice.urp.entity.Role;
import com.sservice.urp.vo.RolePermissionUnion;
import com.sservice.urp.vo.RoleVo;

import java.util.List;

public interface IRoleDao {
    int deleteByPrimaryKey(Integer id);

    int insert(Role record);

    List<Role> queryAll();

    int insertSelective(Role record);

    int selectId();

    Role selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Role record);

    int updateByPrimaryKey(Role record);

    /**
     * get roles by userid
     *
     * @param userid
     * @return
     */
    List<Role> getRolesByUserID(int userid);

    List<Role> getRoleList(Role role);

    /**
     * 获取用户角色
     *
     * @param userid
     * @return
     */
    List<Role> getUserRoleByUserId(int userid);

    List<RolePermissionUnion> queryAllRoleWithPermission();

    /**
     * 统计
     *
     * @return
     */
    int queryByCount(RoleVo role);

    /**
     * 分页
     *
     * @return
     */
    List<RoleVo> queryByPage(RoleVo role);
}